﻿Public Class EditPelatesUserControl

    Public Function keepetaira() As String
        Dim fileReader As String = "none"
        Try
            fileReader = My.Computer.FileSystem.ReadAllText(Application.StartupPath & _
                                            "\keppetairia.txt")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
        Return fileReader
    End Function

    Private Sub PelatesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PelatesBindingNavigatorSaveItem.Click

        Me.Validate()
        Me.PelatesBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Hard_oneDataSet)

    End Sub

    Private Sub EditPelatesUserControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.PelatesTableAdapter.FillByName(Me.Hard_oneDataSet.pelates, "%" & TextBox1.Text & "%", "%" & keepetaira() & "%")
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Me.PelatesTableAdapter.Fill(Me.Hard_oneDataSet.pelates)
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Me.PelatesTableAdapter.FillByName(Me.Hard_oneDataSet.pelates, "%" & TextBox1.Text & "%", "%" & keepetaira() & "%")
    End Sub

    Private Sub TextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Click
        Me.PelatesTableAdapter.FillByName(Me.Hard_oneDataSet.pelates, "%" & TextBox1.Text & "%", "%" & keepetaira() & "%")
    End Sub

End Class
